<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=utf-8"%>

<!DOCTYPE html>
<html>
<head>
<title>REGIST</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="The Opoiki Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- bootstrap-css -->
	<link href="../css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!--// bootstrap-css -->
<!-- css -->
	<link rel="stylesheet" href="../css/style.css" type="text/css" media="all" />
<!--// css -->
<!-- js -->
	<script type="text/javascript" src="../js/jquery.min.js"></script>
<!-- js -->
<!--fonts-->
	<link href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<!--/fonts-->
	<!-- start-smoth-scrolling -->
		<script type="text/javascript" src="../js/move-top.js"></script>
		<script type="text/javascript" src="../js/easing.js"></script>
		<script type="text/javascript">
			jQuery(document).ready(function($) {
				$(".scroll").click(function(event){		
					event.preventDefault();
					$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
				});
				$("#menu_login").addClass("active");
				document.getElementById('username').focus();
			});
		</script>
		
		<script type="text/javascript">
			$(document).ready(function(){
				$("#submit").click(function(){
					$.ajax({
					type: "POST",//访问WebService使用Post方式请求
					url: "user/user_regist", //调用WebService的地址和方法名称组合 ---- WsURL/方法名
					data: $("#userform").serialize(), //这里是要传递的参数，格式为 data: "{paraName:paraValue}",下面将会看到
					dataType: 'json', //WebService 会返回Json类型
					success: function(json) {
							if (json.result == "success") {
								location.href="user_main";
							}else{
								alert(json.data)
								validate_refrash()
							}
						},
					error:function(json){
								alert(json.data)
								validate_refrash()
						}
					});
				});
				$("#validate").keydown(function(e){
					if(e.keyCode == 13) {
						$("#submit").click();
					}
				});
			});
			
			function validate_refrash(){
				$("#validateCode").attr("src", "validate_code?" + Math.floor(Math.random()*100))
			}
		</script>
		
	<!-- start-smoth-scrolling -->

</head>
<body>
<%@ include file="../public/header.jsp" %>
<!-- contact-page -->
<div class="contact">
	<div class="container">
		<!--<div class="contact-info">
			<h3>KEEP IN <span>TOUCH</span></h3>
		</div>
		<div class="contact-map">
			<iframe src="https://www.google.com/maps/embed?pb=!1m10!1m8!1m3!1d2482.432383990807!2d0.028213999961443994!3d51.52362882484525!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sen!2sin!4v1423469959819" frameborder="0" style="border:0"></iframe>
		</div>-->
		<div class="contact-form">
			<div class="contact-info">
				<h3>注册 <span>开发者账号</span></h3>
			</div>
			<form id="userform">
				<div class="contact-left">
					<input id="username" name="username" type="text" placeholder="用户名" required>
					<input id="password" name="password" type="password" placeholder="密码" required>
					<input id="passwordComfirm" name="passwordComfirm" type="password" placeholder="再次输入密码" required>
					<input id="appURL" name="appURL" type="text" placeholder="您的网站应用地址" required>
					<input id="validate" name="validate" type="text" placeholder="验证码" style="width:52%; margin-right:5px" required>
					<img id="validateCode" title="refrash"  src="validate_code" onclick="validate_refrash()"/>
					<input id="submit" type="button" value="注册">
				</div>
				<div class="contact-right">
					<!--<textarea placeholder="Message" required></textarea>-->
				</div>
				<div class="clearfix"></div>
				<%--<input id="submit" type="button" value="LOGIN">--%>
			</form>
		</div>
	</div>
</div>
<!--footer-->
<%@ include file="../public/footer.jsp" %>
<!--//footer-->
<!-- smooth scrolling -->
	<script type="text/javascript">
		$(document).ready(function() {
		/*
			var defaults = {
			containerID: 'toTop', // fading element id
			containerHoverID: 'toTopHover', // fading element hover id
			scrollSpeed: 1200,
			easingType: 'linear' 
			};
		*/								
		$().UItoTop({ easingType: 'easeOutQuart' });
		});
	</script>
	<a href="#" id="toTop" style="display: block;"> <span id="toTopHover" style="opacity: 1;"> </span></a>
<!-- //smooth scrolling -->
</body>
</html>